Skip to content

Configuration properties changelog generator misses items that are removed without prior deprecation #45267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

yybmion
Copy link
Contributor

@yybmion yybmion commented Apr 23, 2025

Issue

Closes #40075

The configuration properties changelog generator misses items that are removed without prior deprecation. When a property is removed without being deprecated first (like during the Flyway 10 upgrade), these changes are reflected in the metadata but not included in the generated changelog.

Solution

Modified the computeDifferences method in the Changelog class to detect properties that only exist in the new metadata with error-level deprecation and properly mark them as DELETED in the changelog. This ensures that properties that are added to a new version with error-level deprecation (indicating immediate removal) are correctly included in the "Removed in X.X" section of the changelog.

Specifically, added logic to check for properties in the new metadata that

  1. Don't exist in the old metadata
  2. Have an error-level deprecation
  3. Should be classified as DELETED rather than being ignored

Tests

The existing test diffContainsDifferencesBetweenLeftAndRightInputs already verifies this functionality by testing that properties with error-level deprecation are properly classified as DELETED.

To make the test cover this fix, we enhanced the sample-2.0.json test data to include an additional property (test.removed.directly) that demonstrates a property removed without prior deprecation, marked with error-level deprecation and a reason "Removed in Upgrade 10".

After fix, this test confirms that both regular removed properties and those marked with error-level deprecation are correctly included in the changelog.

The changelog generator did not detect properties that were added to a new
version with error-level deprecation (indicating immediate removal). This
commonly occurs when upgrading dependencies like Flyway 10, where properties
are removed without prior deprecation.

Modified the computeDifferences method to detect properties that only exist
in the new metadata with error-level deprecation and properly mark them as
DELETED in the changelog.

Signed-off-by: yybmion <yunyubin54@gmail.com>
@wilkinsona wilkinsona changed the title Fix changelog generator missing directly removed properties Configuration properties changelog generator misses items that are removed without prior deprecation Apr 25, 2025
@wilkinsona wilkinsona self-assigned this Apr 25, 2025
Comment on lines +53 to +60
if (newProperty == null) {
differences.add(new Difference(DifferenceType.DELETED, oldProperty, null));
}
else {
Difference difference = Difference.compute(oldProperty, newProperty);
if (difference != null) {
differences.add(difference);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't necessary as Difference.compute already handles the case where newProperty is null. Additionally, it checks that the old property isn't deprecated at error level before reporting a difference, something that's lost here.

I'll revert this part of the changes and add a test for this scenario (removing metadata for a property that's deprecated at error level) as part of merging this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your explanation about why that part of the change wasn't necessary and how the existing code already handles the case.

@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 25, 2025
@wilkinsona wilkinsona added this to the 3.3.x milestone Apr 25, 2025
@wilkinsona wilkinsona modified the milestones: 3.3.x, 3.3.12 Apr 25, 2025
wilkinsona pushed a commit that referenced this pull request Apr 25, 2025
The changelog generator did not detect properties that were added to a new
version with error-level deprecation (indicating immediate removal). This
commonly occurs when upgrading dependencies like Flyway 10, where properties
are removed without prior deprecation.

Modified the computeDifferences method to detect properties that only exist
in the new metadata with error-level deprecation and properly mark them as
DELETED in the changelog.

See gh-45267

Signed-off-by: yybmion <yunyubin54@gmail.com>
@wilkinsona
Copy link
Member

wilkinsona commented Apr 25, 2025

Thanks very much, @yybmion, and congratulations on making your first contribution to Spring Boot.

@yybmion
Copy link
Contributor Author

yybmion commented Apr 25, 2025

Thank you @wilkinsona for reviewing and merging the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration properties changelog generator misses items that are removed without prior deprecation
3 participants